package com.sam.im.heiqun.uis.adapters.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sam.im.heiqun.R;
import com.sam.im.heiqun.uis.adapters.NearLocationAdpter;

/**
 * Created by wangguodong on 2017/1/8.
 */

public class NearLocationHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    public final View mView;
    public final ImageView select_address;
    public final TextView address;
    public final TextView addr ;
    private NearLocationAdpter.NearListClickListener mNearListClickListener;

    public NearLocationHolder(View view, NearLocationAdpter.NearListClickListener newNearListClickListener) {
        super(view);
        mView = view;
        this.mNearListClickListener = newNearListClickListener;
        select_address = (ImageView) view.findViewById(R.id.select_address);
        address = (TextView) view.findViewById(R.id.address);
        addr = (TextView) view.findViewById(R.id.tv_addr);
        view.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (mNearListClickListener != null) {
            mNearListClickListener.onSelectClick(v, getAdapterPosition()-2);
        }
    }
}